package com.linchong.concurrency.chapter2.v1;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author:linchong
 * @CreateTime:2019-12-30 23:05
 * @Description:
 */
@Slf4j
public class TicketWindow extends Thread {

	//最大窗口 v1.0
	/**
	 * private final int MAX = 50;
	 * private int index = 1;
	 **/
	private static int index = 1;
	private final static int MAX = 50;

	/**
	 * 柜台名字
	 **/
	private final String name;

	public TicketWindow(String name) {
		this.name = name;
	}

	@Override
	public void run() {
		while (index <= MAX) {
			log.info("柜台：{},当前号码为：{}", name, index++);
		}
	}
}
